package com.thermofisher.dsc.amanda.model.dto.customer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thermofisher.dsc.amanda.model.BaseModel;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.annotation.Bean;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;


@Setter
@Getter
public class ExclusivePriceDto extends BaseModel {

    private String ship2NO;

    private String skuNO;

    private Integer quantity;

    @JsonIgnore
    private BigDecimal price;

    private String priceStr;

    private Integer status;

    @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
    private Date createTime;

    @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
    private Date updateTime;

    public String getPriceStr() {
        if (price != null){
            DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
            return decimalFormat.format(price);
        }
        return null;
    }
}
